Rule-based joining of foreign to primary key

ABSTRACT

Linking of a child table to a parent table in a database system. For a given parent table row, an expression associated with the particular row is identified. The expression may be a semantic expression that comprises something different than or more than an equals expression or a contains expression. The expression might also take as input a field of the parent table other than the primary key of the parent table. For each of multiple (and potentially all) rows of a child table, the expression is evaluated against a foreign key of the corresponding row of the child table. If the foreign key matches the expression, an association is created, and perhaps saved, between the foreign key and the particular row of the parent table. The expressions may differ even down to the granularity of a single row in the parent table, thereby enabling perhaps custom per-row expressions.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent Ser. No. 14/317,056,filed Jun. 27, 2014, and titled “RULE-BASED JOINING OF FOREIGN TOPRIMARY KEY,” the entire contents of which are incorporated by referenceherein in their entirety.

BACKGROUND

Computing systems and associated networks have revolutionized the wayhuman beings work, play, and communicate. Nearly every aspect of ourlives is affected in some way by computing systems. Computing systemsare now largely connected to networks and the Internet so as to enablewidespread communications. Database technologies are enabled through theuser of computing systems. In relational database systems, there aremultiple interrelated tables, where the relationships are defined bylinks between tables.

Often tables are linked such that a field in one table (called the“referencing table” or the “child table”) uniquely identifies a row(e.g., a primary key) of another table (called the “referenced table” orthe “parent table”). Thus, the foreign key is used to establish andenforce a link between the child and parent tables.

Conventionally, the foreign key of the child table uniquely identifiesthe row of the parent table through direct equality in which the foreignkey is exactly the same as the parent key. In the case of the foreignand primary keys both being text, the foreign key of the child tablemight also uniquely identify the row of the parent table by containingthe text of the primary key of that row. Accordingly, the foreign key ofthe child table uniquely identifies a row of the parent table by beingthe same as (or containing in the case of text) the primary key of thatrow.

The subject matter claimed herein is not limited to embodiments thatsolve any disadvantages or that operate only in environments such asthose described above. Rather, this background is only provided toillustrate one exemplary technology area where some embodimentsdescribed herein may be practiced.

BRIEF SUMMARY

At least some embodiments described herein relate to the linking of achild table to a parent table in a database system using a foreign keyin the child table. For a given row of a parent table, an expressionassociated with the particular row is identified. In one embodiment, theexpression is a semantic expression that comprises something differentthan or more than just an equals expression or a contains expression.For instance, the expression might be a compound expression, a rangedexpression, a set expression, and so forth, representing a more complexrelationship. The expression might also take as input a field of theparent table other than the primary key of the parent table.

For each of multiple (and potentially all) rows of a child table, theexpression is evaluated against a foreign key of the corresponding rowof the child table. If the foreign key of the corresponding row of thechild table matches the expression based on the act of evaluating, anassociation is created between the foreign key and the particular row ofthe parent table, and that association may perhaps be persisted, forinstance, for later use in response to a query.

The expression might be applicable to all rows of the parent table tothereby similarly create associations between foreign keys of the childtable and the corresponding matching rows of the parent table. However,in some embodiments, the expressions may differ even down to thegranularity of a single row in the parent table, thereby enablingperhaps custom per-row expressions that define one or more associationcriteria. In that case, perhaps there is a dedicated column in theparent table for such expressions.

This Summary is not intended to identify key features or essentialfeatures of the claimed subject matter, nor is it intended to be used asan aid in determining the scope of the claimed subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to describe the manner in which the above-recited and otheradvantages and features can be obtained, a more particular descriptionof various embodiments will be rendered by reference to the appendeddrawings. Understanding that these drawings depict only sampleembodiments and are not therefore to be considered to be limiting of thescope of the invention, the embodiments will be described and explainedwith additional specificity and detail through the use of theaccompanying drawings in which:

FIG. 1 abstractly illustrates a computing system in which someembodiments described herein may be employed;

FIG. 2 illustrates a database system in which the principles describedherein may operate, and which includes a child table and a parent table;

FIG. 3 illustrates a flowchart of a method for linking a child table toa parent table in a database system using a foreign key field in thechild table;

FIG. 4 illustrates an example database system in which there is a tweetchild table and a movies parent table;

FIG. 5 illustrates an example database system in which there is anemployee child table and a salary range parent table; and

FIG. 6 illustrates a trie structure that is built based on the primarykeys (e.g., the movie titles) of the movie primary table of FIG. 4.

DETAILED DESCRIPTION

At least some embodiments described herein relate to the linking of achild table to a parent table in a database system using a foreign keyin the child table. For a given row of a parent table, an expressionassociated with the particular row is identified. In one embodiment, theexpression is a semantic expression that comprises something differentthan or more than just an equals expression or a contains expression.For instance, the expression might be a compound expression, a rangedexpression, a set expression, and so forth, representing a more complexrelationship. The expression might also take as input a field of theparent table other than the primary key of the parent table.

For each of multiple (and potentially all) rows of a child table, theexpression is evaluated against a foreign key of the corresponding rowof the child table. If the foreign key of the corresponding row of thechild table matches the expression based on the act of evaluating, anassociation is created between the foreign key and the particular row ofthe parent table, and that association may perhaps be persisted, forinstance, for later use in response to a query.

The expression might be applicable to all rows of the parent table tothereby similarly create associations between foreign keys of the childtable and the corresponding matching rows of the parent table. However,in some embodiments, the expressions may differ even down to thegranularity of a single row in the parent table, thereby enablingperhaps custom per-row expressions that define one or more associationcriteria. In that case, perhaps there is a dedicated column in theparent table for such expressions.

Some introductory discussion of a computing system will be describedwith respect to FIG. 1. Then, embodiments of such expression basedassociating will be described with respect to subsequent figures.

Computing systems are now increasingly taking a wide variety of forms.Computing systems may, for example, be handheld devices, appliances,laptop computers, desktop computers, mainframes, distributed computingsystems, or even devices that have not conventionally been considered acomputing system. In this description and in the claims, the term“computing system” is defined broadly as including any device or system(or combination thereof) that includes at least one physical andtangible processor, and a physical and tangible memory capable of havingthereon computer-executable instructions that may be executed by theprocessor. The memory may take any form and may depend on the nature andform of the computing system. A computing system may be distributed overa network environment and may include multiple constituent computingsystems.

As illustrated in FIG. 1, in its most basic configuration, a computingsystem 100 typically includes at least one processing unit 102 andmemory 104. The memory 104 may be physical system memory, which may bevolatile, non-volatile, or some combination of the two. The term“memory” may also be used herein to refer to non-volatile mass storagesuch as physical storage media. If the computing system is distributed,the processing, memory and/or storage capability may be distributed aswell. As used herein, the term “executable module” or “executablecomponent” can refer to software objects, routines, or methods that maybe executed on the computing system. The different components, modules,engines, and services described herein may be implemented as objects orprocesses that execute on the computing system (e.g., as separatethreads).

In the description that follows, embodiments are described withreference to acts that are performed by one or more computing systems.If such acts are implemented in software, one or more processors of theassociated computing system that performs the act direct the operationof the computing system in response to having executedcomputer-executable instructions. For example, such computer-executableinstructions may be embodied on one or more computer-readable media thatform a computer program product. An example of such an operationinvolves the manipulation of data. The computer-executable instructions(and the manipulated data) may be stored in the memory 104 of thecomputing system 100. Computing system 100 may also containcommunication channels 108 that allow the computing system 100 tocommunicate with other message processors over, for example, network110.

Embodiments described herein may comprise or utilize a special purposeor general-purpose computer including computer hardware, such as, forexample, one or more processors and system memory, as discussed ingreater detail below. Embodiments described herein also include physicaland other computer-readable media for carrying or storingcomputer-executable instructions and/or data structures. Suchcomputer-readable media can be any available media that can be accessedby a general purpose or special purpose computer system.Computer-readable media that store computer-executable instructions arephysical storage media. Computer-readable media that carrycomputer-executable instructions are transmission media. Thus, by way ofexample, and not limitation, embodiments of the invention can compriseat least two distinctly different kinds of computer-readable media:computer storage media and transmission media.

Computer storage media includes RAM, ROM, EEPROM, CD-ROM or otheroptical disk storage, magnetic disk storage or other magnetic storagedevices, or any other tangible storage medium which can be used to storedesired program code means in the form of computer-executableinstructions or data structures and which can be accessed by a generalpurpose or special purpose computer.

A “network” is defined as one or more data links that enable thetransport of electronic data between computer systems and/or modulesand/or other electronic devices. When information is transferred orprovided over a network or another communications connection (eitherhardwired, wireless, or a combination of hardwired or wireless) to acomputer, the computer properly views the connection as a transmissionmedium. Transmissions media can include a network and/or data linkswhich can be used to carry desired program code means in the form ofcomputer-executable instructions or data structures and which can beaccessed by a general purpose or special purpose computer. Combinationsof the above should also be included within the scope ofcomputer-readable media.

Further, upon reaching various computer system components, program codemeans in the form of computer-executable instructions or data structurescan be transferred automatically from transmission media to computerstorage media (or vice versa). For example, computer-executableinstructions or data structures received over a network or data link canbe buffered in RAM within a network interface module (e.g., a “NIC”),and then eventually transferred to computer system RAM and/or to lessvolatile computer storage media at a computer system. Thus, it should beunderstood that computer storage media can be included in computersystem components that also (or even primarily) utilize transmissionmedia.

Computer-executable instructions comprise, for example, instructions anddata which, when executed at a processor, cause a general purposecomputer, special purpose computer, or special purpose processing deviceto perform a certain function or group of functions. The computerexecutable instructions may be, for example, binaries, intermediateformat instructions such as assembly language, or even source code.Although the subject matter has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the subject matter defined in the appended claims is notnecessarily limited to the described features or acts described above.Rather, the described features and acts are disclosed as example formsof implementing the claims.

Those skilled in the art will appreciate that the invention may bepracticed in network computing environments with many types of computersystem configurations, including, personal computers, desktop computers,laptop computers, message processors, hand-held devices, multi-processorsystems, microprocessor-based or programmable consumer electronics,network PCs, minicomputers, mainframe computers, mobile telephones,PDAs, pagers, routers, switches, and the like. The invention may also bepracticed in distributed system environments where local and remotecomputer systems, which are linked (either by hardwired data links,wireless data links, or by a combination of hardwired and wireless datalinks) through a network, both perform tasks. In a distributed systemenvironment, program modules may be located in both local and remotememory storage devices.

FIG. 2 illustrates a database system 200 in which the principlesdescribed herein may operate. The database environment 200 includes achild table 210 and a parent table 220. The principles described hereinmay operate upon any configuration of child table and any configurationof parent table regardless of the number of rows and columns in each.

For example purposes only, the child table 210 is illustrated asincluding four rows 211A, 211B, 211C and 211D. However, the ellipses211E represent that the child table 210 may include any number of rows,even fewer than the four illustrated. For instance, the child table 210may include as little as a single row, and as many as an enumerablenumber of rows, and anything in-between. Similarly, the child table 210is illustrated as including a single column 212B, although the ellipses212A and 212C represent that the child table 210 may include any numberof columns. The column 212B is a foreign key column that includes values(not illustrated concretely) that may be used to uniquely identify acorresponding row in the parent table 220.

For example purposes only, the parent table 220 is illustrated asincluding three rows 221A, 221B and 221C. However, the ellipses 221Drepresent that the parent table 220 may include any number of rows, evenfewer than the three illustrated. For instance, the parent table 220 mayinclude as little as a single row, and as many as an enumerable numberof rows, and anything in-between. Similarly, the parent table 220 isillustrated as including four columns 222B, 222C, 222D and 222E,although the ellipses 222A and 222F represent that the parent table 220may include any number of columns. The column 222B is a primary keycolumn that includes values (not illustrated concretely in FIG. 2) thatmay be used to uniquely identify a corresponding row in the parent table220. Although FIG. 2 is illustrated in abstract form, with no valuesillustrated, more concrete examples will be described below with respectto FIGS. 4 and 5.

In this description and in the claims, the terms “row” and “column” areused. The term “row” is not restricted to an element that is stackedvertically, and extended horizontally. Furthermore, the term “column” isnot restricted to an element that is stacked horizontally, and extendedvertically. The manner in which a table is displayed is not important tothe principles of the present invention as described herein. The tablesdescribed herein are not necessarily tables that are illustrated in auser interface, by a computer-readable form. Accordingly, the termshorizontal and vertical have little meaning in such computer-readabletables. Thus, the terms “rows” and “columns” described herein are merelyreferring to two district dimensions of a computer representation of thetable.

In accordance with the principles described herein, associations aremade between at each of least some of the foreign keys in the foreignkey column 212B of the child table 210 and corresponding sets of one ormore rows in parent table 220. In such a manner, the principlesdescribed herein link the child table 210 to a parent table 220.Accordingly, FIG. 3 illustrates a flowchart of a method 300 for linkinga child table to a parent table in a database system using a foreign keyfield in the child table. As the method 300 may be performed within thedatabase system 200 of FIG. 2, the method 300 will now be described withfrequent reference to FIG. 2. The method 300 may be performed by, forinstance, a computing system (such as computing system 100) by one ormore processors of the computing system (e.g., processors 102) executingone or more computer-executable instructions.

The method 300 may be repeated for each row in the parent table. Infact, as described further below, the method 300 may be performedsubstantially concurrently for all rows in the parent table. Such mightbe accomplished using a trie structured. For each row in the parenttable, the method 300 involves identifying an expression (act 301). Theexpression is used for each row in the child table to determine whetherthe child table row is to be associated with the row that corresponds tothe expression in the parent table. To make the determination for eachchild table row with respect to a given parent table row, the expressiontakes as input the foreign key of the child table row one or more fieldsof the parent table row.

For instance, in the context of FIG. 2, the expression associated withthe parent table row 221A is identified, and the foreign key of thechild table row 211A and one or more values of the parent table row 221Awould be provided as input to the expression to evaluation whether thereis a match. Similarly, the foreign key of the child table row 211B andone or more values of the parent table row 221A would be provided asinput to the expression to evaluate whether there is a match. Also, theforeign key of the child table row 211C and one or more values of theparent table row 221A would be provided as input to the expression toevaluate whether there is a match. Finally, at least with respect to theparent table row 221A and the illustrated child table rows 211A through211D, the foreign key of the child table row 211D and one or more valuesof the parent table row 221A would be provided as input to theexpression to evaluate whether there is a match.

Similarly, each of the child table rows 211A through 211D would beevaluated against the expression for the parent table row 211B perhapsat the same time as the child table rows 211A through 211D would beevaluated against the expression for parent table row 211A. Also, eachof the child table rows 211A through 211D would be evaluated against theexpression for the parent table row 211C perhaps at the same time as thechild table rows 221A through 211D would be evaluated against theexpressions for parent table rows 221A and 221B.

Conventionally, expressions defining an association between a foreignkey and a parent table row are simply based on an equality to theprimary key, and is the same for all rows in the parent table. Forinstance, if the foreign key for a given child table row is the same asthe primary key for any of the parent table rows, then an associationwould be made between the foreign key of the child table row and thematching parent table row. In the case of text, the expression may be a“contains” expression. That is, if the foreign key (in the form of text)for a given child table row contains the text of the primary key for anyof the parent table row, then an association would be made between theforeign key of the child table row and the matching parent table row.

In contrast, in accordance with the principles described herein, anexpression may be any expression, including semantic expressions, andcan use values from the parent table row other than the primary key.Furthermore, while not required, the expression may differ by parenttable row. Accordingly, row based expressions of association criteriaare enabled herein. In this description and in the claims, a “semanticexpression” is an expression that semantically describes one or moreassociation criteria, and an equals or contains criteria expressly fallsoutside of the definition of “semantic expression”.

For instance, as an example, a semantic expression includes a componentexpression, a ranged expression, a set expression, or the like. Forinstance, FIG. 4 illustrates an example database system 400 in whichthere is a tweet child table 410 and a movies parent table 420. Thetweet child table 410 includes a foreign key column 412A that listsvarious tweets made. The movie parent table 420 includes a primary keycolumn 422A that lists various movies. In this case, the expression foreach parent table row is identified included within (and identified byreferencing) the expressions column 422B. The expression for parenttable row 421A (i.e., contains [Primary Key] but not “Book”) is acompound semantic expression, and is different than the expressions ofthe remaining parent table rows 421B and 421C (which is contains[Primary Key]).

The method 300 of FIG. 3 will now be described with respect to theexample database system 400 of FIG. 4. The content of dashed-lined box310 may be performed for each child table row. Accordingly, the contentsof dashed-lined box 310 are performed for the tweet “I like HungerGames” in child table row 411A. The tweet “I like Hunger Games” is thenevaluated against the expression “Contains ‘Hunger Games’, but not‘book’”. It is match (“Yes” in decision block 312), and thus anassociation 431 is made (act 313) between the foreign key “I like HungerGames” and the parent table row 421A that contains the movie primary key“Hunger Games”. This is because the tweet “I like Hunger Games” containsthe term “Hunger Games” (the primary key), but does not contain the term“Book”, and is thus a match to the expression in the expression field422B of the corresponding parent table row 421A.

The contents of dashed-lined box 310 are also performed for the tweet “Iliked the Hunger Games book” in child table row 411B. The tweet “I likedthe Hunger Games book” is then evaluated against the expression“Contains ‘Hunger Games’, but not ‘book’”. It is not a match (“No” indecision block 312) because the tweet contains the term “book”.Accordingly, no further evaluation (act 314) of the child table row 411Bneed be performed with respect to the parent table row 421A.

The contents of dashed-lined box 310 are also performed for the tweet “Iliked both Star Wars and Star Trek” in child table row 411C, which isevaluated against the expression “Contains ‘Hunger Games’, but not‘Book’”. It is not a match (“No” in decision block 312). Accordingly, nofurther evaluation (act 314) of the child table row 411C need beperformed with respect to the parent table row 421A.

The contents of dashed-lined box 310 are also performed for the tweet“Hunger Games rocks” in child table row 411D, which is evaluated againstthe expression “Contains ‘Hunger Games’, but not ‘Book’”. It is a match(“Yes” in decision block 312), and thus an association 434 is made (act313) between the foreign key “Hunger Games rocks” and the parent tablerow 421A. This is because the tweet “I like Hunger Games” contains theterm “Hunger Games” (the primary key), but does not contain the term“Book”, and is thus a match to the expression in the expression field422B of the corresponding primary row field 421A.

The method 300 is also performed with respect to the parent table row421B is a similar manner. The contents of dashed-lined box 310 are thusperformed for the tweet “I like Hunger Games” in child table row 411A.The tweet “I like Hunger Games” is evaluated against the expression“Contains ‘Star Wars’” (act 311). It is not a match (“No” in decisionblock 312).

The tweet “I liked the Hunger Games book” is then evaluated against theexpression “Contains ‘Star Wars’” (act 311). It is also not a match(“No” in decision block 312), and thus no association is made.

The tweet “I like both Star Wars and Star Trek” is then evaluatedagainst the expression “Contains ‘Star Wars’” (act 311). It is a match(“Yes” in decision block 312). Accordingly, association 432 is made (act313) between the tweet “I liked both Star Wars and Star Trek” and theparent table row 421B that has the movie primary key “Star Wars”.

The tweet “Hunger Games rocks” is then evaluated against the expression“Contains ‘Star Wars’” (act 311). It is not a match (“No” in decisionblock 312), and thus no association is made.

The method 300 is also performed with respect to the parent table row421C is a similar manner. The contents of dashed-lined box 310 are thusperformed for the tweet “I like Hunger Games” in child table row 411A.The tweet “I like Hunger Games” is evaluated against the expression“Contains ‘Star Trek;” (act 311). It is not a match (“No” in decisionblock 312).

The tweet “I liked the Hunger Games book” is then evaluated against theexpression “Contains ‘Star Trek’” (act 311). It is also not a match(“No” in decision block 312), and thus no association is made.

The tweet “I like both Star Wars and Star Trek” is then evaluatedagainst the expression “Contains ‘Star Trek’” (act 311). It is a match(“Yes” in decision block 312). Accordingly, association 433 is made (act313) between the tweet “I liked both Star Wars and Star Trek” and theparent table row 421B that has the movie primary key “Star Wars”.

A second example is illustrated in FIG. 5, which illustrates an exampledatabase system 500 in which there is an employee child table 510 and asalary range parent table 520. In the child table 510, there is a namecolumn 512A and a salary column 512B. The salary column 512 serves asthe primary key column. In this case, the expression 530 for each parenttable row is the same, but is a complex expression, and uses fieldsother than the primary key field as an input to the expression. Inparticular, the expression 530 indicates that if the foreign key isbetween the value in the minimum column 522B and the maximum column 522Cfor the respective parent table row, then the foreign key will beassociated with the corresponding parent table row.

The method 300 of FIG. 3 will now be described with respect to theexample database system 500 of FIG. 5. The method 300 is performed withrespect to the parent table row 521A having the primary key Small. Thecontent of dashed-lined box 310 may be performed for each of child tablerow 511A and 511B. In each case, however, the salary is not within 0 and49,000 (“No” in decision block 312), and thus there are no associationsmade in this performance of method 300.

The method 300 is also performed with respect to the parent table row521B having the primary key Medium. Here the foreign key 50,000 forchild table row 511A matches (it is between 50,000 and 179,999,inclusive) (“Yes” in decision block 312), and thus association 531 ismade between the foreign key 50,000 of child table row 511A and theparent table row 521B. As for child table row 511B, the value 200,000 isnot between 50,000 and 179,999 (“No” in decision block 312), and thus noassociation is made (act 314).

The method 300 is also performed with respect to the parent table row521C having the primary key High. Here the foreign key 50,000 for childtable row 511A is not 180,000 or greater (“No” in decision block 312),and thus no association is made (act 314). However, the foreign key200,000 for child table row 511B is greater than 180,000 (“Yes” indecision block 312), and thus association 532 is made between theforeign key 200,000 of child table row 511B and the parent table row521C. In this case, the expression was a ranged expression. A setexpression is a case in which the foreign key is evaluated to determineif it is one of a number of values.

As previously mentioned, the method 300 may be concurrently performedfor each parent table row through the use of a trie structure, even ifthe expressions may differ from one parent table row to the next. Theprimary key of the parent table is used to construct a trie structure.For instance, FIG. 6 illustrates a trie structure 600 that is builtbased on the primary keys (e.g., the movie titles) of the movie primarytable 420 of FIG. 4. The trie table is navigated for each foreign keyand to the extent a terminating leaf is encountered, the associatedexpression or expression component (e.g., nodes 631 through 634) islikewise determined to be a match. In the case of a nullifying node(expression component node 634, denoted by a rightward facing zero), thematching to that expression or expression component means that theexpression itself or the expression for which the expression componentis a component, cannot be met on this evaluation of the trie structure600. The case of an affirming node (e.g., nodes 631 through 633, denotedby a rightward facing one), the matching to the expression means thatthe expression is satisfied, or in the case of an expression component,means that expression component is satisfied.

For instance, navigation of the trie structure 600 based on the tweetforeign key “I like Hunger Games” will now be described. Navigationbegins at node 601. Navigation to the next level of the hierarchyhappens upon encountering the text of the next node. For instance, “I”does not match any text of nodes 611, 612 or 613, and so the navigationremains (as represented by line 602) at the parent node 601. “like” isthen evaluated, and again there are no matches to the text of nodes 611,612 or 613. Thus, navigation remains at the parent node 601. “Hunger”matches the text for the next node 611, and thus navigation moves tonode 611. “Games” matches the text for the next hierarchical node 621,and thus navigation moves to the terminating node 621, which isassociated with the first component expression 631 of the compoundexpression within parent table row 421A. Accordingly, the affirming nodefor row 421A is encountered. The foreign key has now been evaluatedwithout encountering the nullifying expression 634 for parent table row421. Accordingly, the association 431 can be made.

Navigation of the trie structure 600 based on the tweet foreign key “Iliked the Hunger Games book” will now be described. Navigation begins atnode 601. “I” does not match any text of nodes 611, 612 or 613, and sothe navigation remains (as represented by line 602) at the parent node601. “liked” is then evaluated, and again there are no matches to thetext of nodes 611, 612 or 613. Thus, navigation remains at the parentnode 601. “the” is then evaluated, and again there are no matches, andnavigation remains at parent node 601. “Hunger” matches the text for thenext node 611, and thus navigation moves to node 611. “Games” matchesthe text for the next hierarchical node 621, and thus navigation movesto the terminating node 621, which is associated with the firstcomponent expression 631 of the compound expression within parent tablerow 421A. Upon reaching a terminating node, navigation returns to parentnode 601. “book” matches the text of the next hierarchical node 613.Accordingly, the nullifying node for row 421A is encountered.Accordingly, no association can be made as the reaching of anynullifying node (e.g., node 634) with respect to a compound expressionnegates any affirming node (e.g., node 631) with respect to the compoundexpression.

Navigation of the trie structure 600 based on the tweet foreign key “Iliked both Star Wars and Star Trek” will now be described. Navigationbegins at node 601. “I” does not match any text of nodes 611, 612 or613, and so the navigation remains at the parent node 601. “liked” isthen evaluated, and again there are no matches to the text of nodes 611,612 or 613, and thus navigation remains at the parent node 601. “both”is then evaluated, and again there are no matches, and navigationremains at parent node 601. “Star” matches the text for the next node612, and thus navigation moves to node 612. “Wars” matches the text forthe next hierarchical node 622, and thus navigation moves to theterminating node 632, which is an affirming node 632 for the expressionin parent table row 421B. There are no nullifying nodes for parent tablerow 421B. Accordingly, the association 432 can be made.

Navigation returns to parent node 601. “and” is then evaluated, andagain there are no matches to the text of nodes 611, 612 or 613, andthus navigation remains at the parent node 601. Star” matches the textfor the next node 612, and thus navigation moves to node 612. “Trek”matches the text for the next hierarchical node 623, and thus navigationmoves to the terminating node 633, which is an affirming node 633 forthe expression in parent table row 421C. There are no nullifying nodesfor parent table row 421C. Accordingly, the association 432 can be made.

Navigation of the trie structure 600 based on the tweet foreign key“Hunger Games rocks” will now be described. Navigation begins at node601. “Hunger” matches the text for the next node 611, and thusnavigation moves to node 611. “Games” matches the text for the nexthierarchical node 621, and thus navigation moves to the terminating node621, which is associated with the first component expression 631 of thecompound expression within parent table row 421A. Accordingly, theaffirming node for row 421A is encountered. Navigation returns to parentnode 601 after reaching a terminating node. “rocks” is then evaluated,and again there are no matches to the text of nodes 611, 612 or 613, andthus navigation remains at the parent node 601. Accordingly, theaffirming node 631 for the expression in parent table row 421A isencountered without reaching the nullifying node 634 for the expressionin the parent table row 421A. Accordingly, the association 431 can bemade.

Accordingly, the principles described herein may be performed toautomatically associate foreign keys of child table rows in a databasewith parent table rows in the database. The principles described hereinallow for complex expressions defining one or more prerequisites formaking the association. Furthermore, expressions may be customized ateven the per-row level, and may use input value other than the primarykey from the parent table row. Thus, a flexible and automated mechanismfor creating associations between a child table and a parent table hasbeen described.

The present invention may be embodied in other specific forms withoutdeparting from its spirit or essential characteristics. The describedembodiments are to be considered in all respects only as illustrativeand not restrictive. The scope of the invention is, therefore, indicatedby the appended claims rather than by the foregoing description. Allchanges which come within the meaning and range of equivalency of theclaims are to be embraced within their scope.

What is claimed is:
 1. A computer system that links a child table to aparent table in a database, comprising: a processor; and a hardwarestorage device having stored thereon computer-executable instructionsthat are structured such that, when executed by the processor, thecomputer-executable instructions cause the computer system to perform atleast the following: identify a semantic expression that is stored in arow of the parent table, the semantic expression at least describing asemantic relationship using association criteria and referencing aprimary key in the row of the parent table; for a row of a child table,perform the following: determine that a foreign key in the row of thechild table satisfies the semantic expression, satisfaction of thesemantic expression being other than a direct equality of the foreignkey in the row of the child table to the primary key in the row of theparent table; and based at least on the foreign key in the row of thechild table satisfying the semantic expression, create an associationbetween the foreign key in the row of the child table and the row of theparent table.
 2. The computer system in accordance with claim 1, thesemantic relationship comprising a compound expression.
 3. The computersystem in accordance with claim 1, the semantic relationship comprisinga ranged expression.
 4. The computer system in accordance with claim 1,the semantic relationship comprising a set expression.
 5. The computersystem in accordance with claim 1, the semantic expression alsoreferencing a field in the row of the parent table other than theprimary key in the row of the parent table.
 6. The computer system inaccordance with claim 1, the semantic expression being a first semanticexpression, the row of the parent table being a first row of the parenttable, the primary key of the first row being a first primary key, therow of the child table being a first row of the child table, and theforeign key in the first row being a first foreign key, thecomputer-executable instructions also causing the computer system toperform at least the following: identify a second semantic expressionstored in a second row of the parent table; for a second of the childtable, perform the following: determine that a second foreign key in thesecond row of the child table satisfies the second semantic expression,satisfaction of the second semantic expression being other than a directequality of the second foreign key in the second row of the child tableto the second primary key in the second row of the parent table; andbased at least on the second foreign key in the second row of the childtable satisfying the second semantic expression, create an associationbetween the second foreign key in the second row of the child table andthe second row of the parent table.
 7. The computer system in accordancewith claim 6, the second semantic expression being a same semanticexpression as the first semantic expression.
 8. The computer system inaccordance with claim 6, the second semantic expression being adifferent semantic expression than the first semantic expression.
 9. Thecomputer system in accordance with claim 6, the computer-executableinstructions also causing the computer system to formulate a triestructure using at the first and second primary keys, a terminating nodeof the trie structure corresponding to at least the first and secondsemantic expressions.
 10. The computer system in accordance with claim1, creating the association also comprising saving the association. 11.A method, implemented at a computer system that includes one or moreprocessors, for linking a child table to a parent table in a databasesystem, the method comprising: identifying a semantic expression that isstored in a row of the parent table, the semantic expression at leastdescribing a semantic relationship using association criteria andreferencing a primary key in the row of the parent table; for a row of achild table, performing the following: determining that a foreign key inthe row of the child table satisfies the semantic expression,satisfaction of the semantic expression being other than a directequality of the foreign key in the row of the child table to the primarykey in the row of the parent table; and based at least on the foreignkey in the row of the child table satisfying the semantic expression,creating an association between the foreign key in the row of the childtable and the row of the parent table.
 12. The method in accordance withclaim 10, the foreign key being tokenized text.
 13. The method inaccordance with claim 10, the semantic relationship comprising acompound expression.
 14. The method in accordance with claim 10, thesemantic relationship comprising a ranged expression.
 15. The method inaccordance with claim 10, the semantic relationship comprising a setexpression.
 16. The method in accordance with claim 10, the semanticexpression also referencing a field in the row of the parent table otherthan the primary key in the row of the parent table.
 17. The method inaccordance with claim 10, the semantic expression being a first semanticexpression, the row of the parent table being a first row of the parenttable, the primary key of the first row being a first primary key, therow of the child table being a first row of the child table, and theforeign key in the first row being a first foreign key, the method alsocomprising: identifying a second semantic expression stored in a secondrow of the parent table; for a second of the child table, performing thefollowing: determining that a second foreign key in the second row ofthe child table satisfies the second semantic expression, satisfactionof the second semantic expression being other than a direct equality ofthe second foreign key in the second row of the child table to thesecond primary key in the second row of the parent table; and based atleast on the second foreign key in the second row of the child tablesatisfying the second semantic expression, creating an associationbetween the second foreign key in the second row of the child table andthe second row of the parent table.
 18. The method in accordance withclaim 17, the second semantic expression being a same semanticexpression as the first semantic expression.
 19. The method inaccordance with claim 17, the second semantic expression being adifferent semantic expression than the first semantic expression.
 20. Acomputer program product comprising one or more hardware storage deviceshaving stored thereon computer-executable instructions that arestructured such that, when executed by one or more processors of acomputing system, the computer-executable instructions cause thecomputing system to link a child table to a parent table in a databasesystem, including performing at least the following: identifying asemantic expression that is stored in a row of the parent table, thesemantic expression at least describing a semantic relationship usingassociation criteria and referencing a primary key in the row of theparent table; for a row of a child table, performing the following:determining that a foreign key in the row of the child table satisfiesthe semantic expression, satisfaction of the semantic expression beingother than a direct equality of the foreign key in the row of the childtable to the primary key in the row of the parent table; and based atleast on the foreign key in the row of the child table satisfying thesemantic expression, creating an association between the foreign key inthe row of the child table and the row of the parent table.